package com.ittx.dzt.tiktok.consumer;

import com.ittx.dzt.tiktok.consumer.handler.TiktokBatchSplitHandler;
import lombok.extern.slf4j.Slf4j;
import org.apache.rocketmq.spring.core.RocketMQListener;
import org.springframework.beans.factory.annotation.Autowired;

/**
 * 数据批量转单个消费者父类
 *
 * @Author: gywang
 * @Date: 2024-07-15
 */
@Slf4j
public abstract class AbstractBatchSplitConsumer implements RocketMQListener<String> {

    @Autowired
    TiktokBatchSplitHandler tiktokBatchSplitHandler;

    @Override
    public void onMessage(String message) {
        tiktokBatchSplitHandler.onMessage(message, this.getLogsStr());
    }

    /**
     * 获取日志字符串
     *
     * @return
     */
    public abstract String getLogsStr();
}
